#include once "mud-gui/ui.bi"
#include once "mud-gui/gclass.bi"
#include once "mud-gui/util.bi"
#include once "mud-gui/event.bi"
#include once "mud-gui/widgets/basewidget.bi"

#inclib "mudgui-stdwidgets"

#ifndef _MUDGUI_CANVAS_BI__
#define _MUDGUI_CANVAS_BI__ -1

namespace ui

gclass(Canvas)

	declare constructor ( byval parent as BaseWidget ptr = 0, byval _fgcolor as uinteger = rgb(255,255,255), _
						byval _bgcolor as uinteger = rgb(0,0,0) )

	DEF_PROPERTY( fgColor, uinteger )
	DEF_PROPERTY( bgColor, uinteger )
	DEF_PROPERTY( drawable, ubyte )
	DEF_BPROPERTY( imageData, fb.image ptr ) 'takes ownership of image.
	DEF_BPROPERTY( minimumWidth, integer )
	DEF_BPROPERTY( minimumHeight, integer )

	'functions
	declare sub drawCircle(byval x as integer, byval y as integer, byval r as integer, byval clr as uinteger = rgb(255,255,255))
	declare sub drawFilledCircle( byval x as integer, byval y as integer, byval r as integer, byval clr as uinteger = rgb(255,255,255))
	declare sub drawLine( byval x as integer, byval y as integer, byval x2 as integer, byval y2 as integer, byval clr as uinteger = rgb(255,255,255) )
	declare sub drawBox( byval x as integer, byval y as integer, byval x2 as integer, byval y2 as integer, byval clr as uinteger = rgb(255,255,255) )
	declare sub drawFilledBox( byval x as integer, byval y as integer, byval x2 as integer, byval y2 as integer, byval clr as uinteger = rgb(255,255,255) )
	declare sub drawPixel( byval x as integer, byval y as integer, byval clr as uinteger = rgb(255,255,255) )
	declare sub clear( )
	
	'signal handlers
	declare STATIC_SLOT(click_handler)
	declare STATIC_SLOT(mouseover_handler)
	declare STATIC_SLOT(mousedown_handler)
	declare STATIC_SLOT(resize_handler)
	declare STATIC_SLOT(PaintEvent)

	as integer m_mouseIsDown, m_whatMouseButtonAgain, r_x, r_y

endgclass


end namespace

#endif